<?php
    $controller_name = $this->params['controller'];
    
    $activeHome = $controller_name == 'home' ? "active" : "";
    $activeCategory = $controller_name == 'category' ? "active" : "";
    $activeArticle = $controller_name == 'article' ? "active" : "";
    $activeMenu = $controller_name == 'menu' ? "active" : "";
    $activeMedia = $controller_name == 'media' ? "active" : "";
    $activeProduct = ($controller_name == 'product' || $controller_name == 'composition') ? "active" : "";

    $activeCart = $controller_name == 'cart' ? "active" : "";
    $activeUser = $controller_name == 'users' ? "active" : "";
    $activeNewsletter = $controller_name == 'newsletter' ? "active" : "";
    $activeTranslate = $controller_name == 'translate' ? "active" : "";
    $activeSetting = $controller_name == 'setting' ? "active" : "";
?>

<!-- add "navbar-no-scroll" class to disable the scrolling of the sidebar menu -->
<ul class="page-sidebar-menu" data-auto-scroll="true" data-slide-speed="200">
	<li class="sidebar-toggler-wrapper">
		<!-- BEGIN SIDEBAR TOGGLER BUTTON -->
		<div class="sidebar-toggler hidden-phone">
		</div>
		<!-- BEGIN SIDEBAR TOGGLER BUTTON -->
	</li>
    <li style="margin-top: 20px;" class="start <?php echo $activeHome ?>">
		<a href="<?php echo $this->Admin->admin_url() ?>home">
			<i class="fa fa-home"></i>
			<span class="title">
				Dashboard
			</span>
			<?php
                echo $activeHome != "" ? '<span class="selected"></span>' : "";
            ?>
		</a>
	</li>
	<li class="<?php echo $activeCategory ?> ">
		<a href="<?php echo $this->Admin->admin_url() ?>category">
			<i class="fa fa-list"></i>
			<span class="title">
                Category
			</span>
            <?php
                echo $activeCategory != "" ? '<span class="selected"></span>' : "";
            ?>
		</a>
	</li>
	<li class="<?php echo $activeArticle ?>">
		<a href="<?php echo $this->Admin->admin_url() ?>article">
			<i class="fa fa-file-text"></i>
			<span class="title">
				Article
			</span>
            <?php
                echo $activeArticle != "" ? '<span class="selected"></span>' : "";
            ?>
		</a>
	</li>
    
    <li class="<?php echo $activeMenu ?>">
		<a href="<?php echo $this->Admin->admin_url() ?>menu">
			<i class="fa fa-sitemap"></i>
			<span class="title">
				Menu
			</span>
			<?php
                echo $activeMenu != "" ? '<span class="selected"></span>' : "";
            ?>
		</a>
	</li>
    <li class="<?php echo $activeMedia ?>">
		<a href="<?php echo $this->Admin->admin_url() ?>media">
			<i class="fa fa-sitemap"></i>
			<span class="title">
				Media
			</span>
			<?php
                echo $activeMedia != "" ? '<span class="selected"></span>' : "";
            ?>
		</a>
	</li>
    <!--
	<li>
		<a href="javascript:;">
			<i class="fa fa-qrcode"></i>
			<span class="title">
				Menu
			</span>
		</a>
	</li>
	<li>
		<a href="javascript:;">
			<i class="fa fa-puzzle-piece"></i>
			<span class="title">
				Menu
			</span>
		</a>
	</li>
	<li>
		<a href="javascript:;">
			<i class="fa fa-exchange"></i>
			<span class="title">
				Menu
			</span>
		</a>
	</li>
    -->
	<li class="<?php echo $activeProduct ?>">
		<a href="javascript:;">
			<i class="fa fa-gift"></i>
			<span class="title">
				Product
			</span>
            <?php
                echo $activeProduct != "" ? '<span class="selected"></span>' : "";
            ?>
			<span class="arrow ">
			</span>
		</a>
		<ul class="sub-menu">
			<li>
				<a href="<?php echo $this->Admin->admin_url() ?>product">
					 <i class="fa fa-gift"></i> View all
				</a>
			</li>
			<li>
				<a href="<?php echo $this->Admin->admin_url() ?>product/add">
					 <i class="fa fa-gift"></i> Add new product
				</a>
			</li>
            <li>
				<a href="<?php echo $this->Admin->admin_url() ?>composition">
					 <i class="fa fa-gift"></i> Composition
				</a>
			</li>
		</ul>
	</li>
    <li class="<?php echo $activeCart ?>">
		<a href="<?php echo $this->Admin->admin_url() ?>cart">
			<i class="fa fa-shopping-cart"></i>
			<span class="title">
				Cart
			</span>
            <?php
                echo $activeCart != "" ? '<span class="selected"></span>' : "";
            ?>
		</a>
	</li>
	<li class="<?php echo $activeUser ?>">
		<a href="javascript:;">
			<i class="fa fa-users"></i>
			<span class="title">
				User
			</span>
            <?php
                echo $activeUser != "" ? '<span class="selected"></span>' : "";
            ?>
			<span class="arrow ">
			</span>
		</a>
		<ul class="sub-menu">
			<li>
				<a href="<?php echo $this->Admin->admin_url() ?>users">
					 <i class="fa fa-users"></i> View all
				</a>
			</li>
			<li>
				<a href="<?php echo $this->Admin->admin_url() ?>users/add">
					 <i class="fa fa-users"></i> Add new user
				</a>
			</li>
		</ul>
	</li>
    <li class="<?php echo $activeNewsletter ?>">
		<a href="<?php echo $this->Admin->admin_url() ?>newsletter">
			<i class="fa fa-cogs"></i>
			<span class="title">
				Newsletter
			</span>
            <?php
                echo $activeNewsletter != "" ? '<span class="selected"></span>' : "";
            ?>
		</a>
	</li>
    <li class="<?php echo $activeTranslate ?>">
		<a href="<?php echo $this->Admin->admin_url() ?>translate">
			<i class="fa fa-cogs"></i>
			<span class="title">
				Translate
			</span>
            <?php
                echo $activeTranslate != "" ? '<span class="selected"></span>' : "";
            ?>
		</a>
	</li>
    <li class="<?php echo $activeSetting ?>">
		<a href="<?php echo $this->Admin->admin_url() ?>setting">
			<i class="fa fa-cogs"></i>
			<span class="title">
				Setting
			</span>
            <?php
                echo $activeSetting != "" ? '<span class="selected"></span>' : "";
            ?>
		</a>
	</li>
</ul>